﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace C4F.DevKit.Bluetooth.ServiceAndDeviceDiscovery
{

    /// <summary>
    /// Represents the WSADATA structure used in call to Initialize Winsock.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct WsaData
    {
        /// <summary>
        /// Version of the Windows Sockets specification that 
        /// the Ws2_32.dll expects the caller to use.
        /// </summary>
        public short Version;
        /// <summary>
        /// Highest version of the Windows Sockets specification
        /// that this .dll can support 
        /// </summary>
        public short HighVersion;
        /// <summary>
        /// Null-terminated ASCII string into which the Ws2_32.dll 
        /// copies a description of the Windows Sockets implementation.
        /// </summary>
        [MarshalAs(UnmanagedType.ByValTStr,
            SizeConst = BluetoothHelper.WSADESCRIPTION_LEN + 1)]
        public string Description;
        /// <summary>
        /// Null-terminated ASCII string into which the WSs2_32.dll
        /// copies relevant status or configuration information. 
        /// </summary>
        [MarshalAs(UnmanagedType.ByValTStr,
            SizeConst = BluetoothHelper.WSASYS_STATUS_LEN + 1)]
        public string SystemStatus;
        /// <summary>
        /// Retained for backward compatibility, but should be ignored
        /// for Windows Sockets version 2 and later, as no single value 
        /// can be appropriate for all underlying service providers.
        /// </summary>
        public short MaxSockets;
        /// <summary>
        /// Ignored for Windows Sockets version 2 and onward.
        /// </summary>
        public short MaxUdpDg;
        /// <summary>
        /// Ignored for Windows Sockets version 2 and onward.
        /// </summary>
        public IntPtr VendorInfo;
    }
}
